package oj;

import java.util.Scanner;

/**
 * @author Liangyaoyun
 */
public class sbOj {

    public static void main(String[] args) {
        Scanner cin=new Scanner(System.in);
        int len= cin.nextInt();
        int[] nums=new int[len];
        for (int i = 0; i < len; i++) {
            nums[i]= cin.nextInt();
        }
        int target=cin.nextInt();
        int left=0;
        int right= len-1;
        boolean flag=false;
        int middle=0;
        while (left<=right){
             middle=(left+right)/2;
            if (nums[middle]==target){
                flag=true;
                break;
            }else if (nums[middle]>target){
                right=middle-1;
            }
            else {
                left=middle+1;
            }
        }
        if (flag){
            System.out.print(middle+1);
        }
        else {
            System.out.println(0);
        }
    }

}
